using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class TPI_USERMap : EntityTypeConfiguration<TPI_USER>
    {
        public TPI_USERMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Code)
                .HasMaxLength(20);

            this.Property(t => t.FullName)
                .HasMaxLength(40);

            this.Property(t => t.Username)
                .HasMaxLength(30);

            // Table & Column Mappings
            this.ToTable("TPI_USER");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.FullName).HasColumnName("FullName");
            this.Property(t => t.Username).HasColumnName("Username");
            this.Property(t => t.Disabled).HasColumnName("Disabled");
        }
    }
}
